package com.itheima.innerClass.test1;

public class innerClass {
    public static void main(String[] args) {
        Inter1Impl inter1 = new Inter1Impl();
        inter1.show();

        //使用匿名内部类调用inter1中的show()方法
        new Inter1() {
            @Override
            public void show() {
                System.out.println("我是匿名内部类当中的show方法");
            }
        }.show();


        Inter2 inter2 = new Inter2() {
            @Override
            public void show1() {
                System.out.println("我是匿名内部类当中的show1方法");
            }

            @Override
            public void show2() {
                System.out.println("我是匿名内部类当中的show1方法");

            }
        };

        inter2.show1();
        inter2.show2();
    }
}

interface Inter1{
    void show();
}

interface Inter2{
    void show1();
    void show2();
}

class Inter1Impl implements Inter1{

    @Override
    public void show() {
        System.out.println("这是实现类当中的show方法");
    }
}
